home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_096 / animplayer / loadiff.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  2KB  |  76 lines

  1. /***************************************************************************
  2.  *
  3.  *   NAME 
  4.  *      LoadIFF -- call an IFF single frame from disk
  5.  *
  6.  *   SYNOPSIS
  7.  *      LoadIFF( frame, bitmap, viewport );
  8.  * 
  9.  *      WORD frame;
  10.  *      struct BitMap *bitmap;
  11.  *      struct ViewPort *viewport;
  12.  *
  13.  *   DESCRIPTION
  14.  *      To recall an animation HAM screen that has been saved to disk
  15.  *      under a subdirectory created with the name of the choreography,
  16.  *      this program calls each file with a name that is the number of
  17.  *      the frame.
  18.  *
  19.  *       copyright (c) 1987 Martin D. Hash
  20.  *
  21.  *   LAST EDITED
  22.  *      Martin Hash            11 Aug 1987
  23.  *
  24.  *   EDIT HISTORY
  25.  *      19 Dec 1986  MH  Created.
  26.  *      21 Mar 1987      Converted to real-time audition.
  27.  *
  28.  **********************************************************************/
  29.  
  30. #include <exec/types.h>
  31. #include <intuition/intuition.h>
  32. #include <libraries/dos.h>
  33. #include <libraries/dosextens.h>
  34. #include "df1:ilbm.h"
  35. #include "df1:FileCons.h"
  36.  
  37. /* EXTERNAL VARIABLES */
  38.  
  39. extern char animpathname[];
  40.  
  41. /* EXTERNAL FUNCTIONS */
  42.  
  43. struct FileLock *Lock();
  44. BOOL UserRequest();
  45.  
  46. /* FUNCTION */
  47.  
  48. void LoadIFF( frame, bitmap, viewport )
  49.  
  50. WORD frame;
  51. struct BitMap *bitmap;
  52. struct ViewPort *viewport;
  53. {
  54.    /* LOCAL VARIABLES */
  55.  
  56.    BPTR file;
  57.    struct FileLock *lock;
  58.    char name[STRINGSIZE],
  59.         text[MAXNUMBERTEXT];
  60.  
  61.    /* FUNCTION */
  62.  
  63.    strcpy( name, animpathname );
  64.    stci_d( text, (int)frame, sizeof(text));
  65.    strcat( name, text );
  66.  
  67.    if ((lock = Lock( name, ACCESS_READ )) != 0) {
  68.       file = Open( name, MODE_OLDFILE );
  69.       UnLock( lock );
  70.  
  71.       ReadPicture( file, bitmap, viewport );
  72.  
  73.       Close( file );
  74.    }
  75. }
  76.